import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 用户操作日志信息 */
export interface UserActionLog {
          id: number; // 用户操作id
          userId?: number; // 用户id
          action: string; // 操作
  }

// 用户操作日志 API
export const UserActionLogApi = {
  // 查询用户操作日志分页
  getUserActionLogPage: async (params: any) => {
    return await request.get({ url: `/biz/user-action-log/page`, params })
  },

  // 查询用户操作日志详情
  getUserActionLog: async (id: number) => {
    return await request.get({ url: `/biz/user-action-log/get?id=` + id })
  },

  // 新增用户操作日志
  createUserActionLog: async (data: UserActionLog) => {
    return await request.post({ url: `/biz/user-action-log/create`, data })
  },

  // 修改用户操作日志
  updateUserActionLog: async (data: UserActionLog) => {
    return await request.put({ url: `/biz/user-action-log/update`, data })
  },

  // 删除用户操作日志
  deleteUserActionLog: async (id: number) => {
    return await request.delete({ url: `/biz/user-action-log/delete?id=` + id })
  },

  /** 批量删除用户操作日志 */
  deleteUserActionLogList: async (ids: number[]) => {
    return await request.delete({ url: `/biz/user-action-log/delete-list?ids=${ids.join(',')}` })
  },

  // 导出用户操作日志 Excel
  exportUserActionLog: async (params) => {
    return await request.download({ url: `/biz/user-action-log/export-excel`, params })
  },
}